package com.itheima.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.itheima.pojo.Emp;
import com.itheima.pojo.EmpQueryParam;
import org.apache.ibatis.annotations.*;

import java.time.LocalDate;
import java.util.List;
import java.util.Map;

@Mapper
public interface EmpMapper extends BaseMapper<Emp> {
//    @Select("select count(*) from emp left join dept on emp.dept_id = dept.id")
//    Long getTotal();


//    @Select("select emp.* ,dept.name as deptName from emp left join dept on dept.id = emp.dept_id")
//    List<Emp> selectAll(EmpQueryParam empQueryParam);

//    @Options(useGeneratedKeys = true,keyProperty = "id")
//    @Insert("insert into emp (username, name, gender, phone, job, salary, image, entry_date, dept_id, create_time, update_time) " +
//            "values (#{username}, #{name}, #{gender}, #{phone}, #{job}, #{salary}, #{image}, #{entryDate}, #{deptId}, #{createTime}, #{updateTime})")
//    void sava(Emp emp);

//    void deleteEmp(@Param("ids") List<Integer> ids);

//    Emp getEmpWithExprGetById(Integer id);
//
//    @Select("select * from emp where id = #{id}")
//    Emp getEmpById(Integer id);

//    void updateEmpById(Emp emp);

    List<Map> getEmpData();

    List<Map> getEmpGenderData();

//    @Select("select * from emp")
//    List<Emp> findAll();

    @Select("select count(*) from emp where dept_id = #{id}")
    Integer getEmpCountById(Integer id);
//
//    @Select("select * from emp where username = #{username} and password = #{password} ")
//    Emp getByIdUsernameAndPassword(@Param("username") String username,@Param("password") String password);



}
